package models

import (
	"github.com/saxon134/go-utils/saOrm"
	"time"
)

const TBNResource = "resource"

type TblResource struct {
	Id         int64      `orm:"" json:"id" form:"id"`
	CreateAt   *time.Time `orm:"" json:"createAt" form:"createAt"`
	InstanceId string     `orm:"varchar(64);comment:实例ID" json:"instanceId" form:"instanceId"`
	Type       int        `orm:"tinyint;comment:1-ECS 2-RDS 3-Redis" json:"type" form:"type"`
	Status     int        `orm:"tinyint;comment:-1-已删除 0-未知 2-正常 10-异常" json:"status" form:"status"`
	Name       string     `orm:"varchar(40)" json:"name" form:"name"`
	Cpu        int        `orm:"tinyint;comment:核心数" json:"cpu" form:"cpu"`
	Memo       int        `orm:"integer;comment:内存,MB" json:"memo" form:"memo"`
	PublicIp   string     `orm:"varchar(48);comment:公网，多个逗号隔开" json:"publicIp" form:"publicIp"`
	InnerIp    string     `orm:"varchar(48);comment:内网，多个逗号隔开" json:"innerIp" form:"innerIp"`
	Config     saOrm.Dic  `orm:"text;comment:详细配置信息" json:"config" form:"config"`
	Monitor    saOrm.Dic  `orm:"text;comment:监控信息，包含更新时间" json:"monitor" form:"monitor"`
}

func (m *TblResource) TableName() string {
	return TBNResource
}
